/**
 * Generali Solutions d'assurances - Tous droits réservés &copy; 2007 - 2010
 */

package fr.generali.accueilclient.opt.detaildossier.builder;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import fr.generali.accueilclient.opt.detaildossier.om.IDateRangeDetailDossier;
import fr.generali.accueilclient.opt.detaildossier.om.IFamilleProduitDetailDossier;
import fr.generali.accueilclient.opt.detaildossier.om.IMonetaryQuantity;
import fr.generali.accueilclient.opt.detaildossier.om.IMotifsDetailDossier;
import fr.generali.accueilclient.opt.detaildossier.om.impl.DTODossierDetailDossier;

/**
 * @author Holmes Kelly
 */
public class DTODossierDetailDossierBuilder extends DTODossierDetailDossierBuilderBase<DTODossierDetailDossierBuilder> {

    /**
     * constructeur
     */
    public DTODossierDetailDossierBuilder() {
        super(new DTODossierDetailDossier());
    }

    /**
     * @return DTODossierDetailDossierBuilder
     */
    public static DTODossierDetailDossierBuilder dTODossierDetailDossier() {
        return new DTODossierDetailDossierBuilder();
    }

    /**
     * @return DTODossierDetailDossier
     */
    public DTODossierDetailDossier build() {
        return getInstance();
    }
}

/**
 * @author Holmes Kelly
 * @param <GeneratorT>
 */
class DTODossierDetailDossierBuilderBase<GeneratorT extends DTODossierDetailDossierBuilderBase<GeneratorT>> {

    /**
     * instance
     */
    private DTODossierDetailDossier instance;

    /**
     * @param aInstance instance
     */
    protected DTODossierDetailDossierBuilderBase(DTODossierDetailDossier aInstance) {
        instance = aInstance;
    }

    /**
     * @return DTODossierDetailDossier
     */
    protected DTODossierDetailDossier getInstance() {
        return instance;
    }

    /**
     * @param aValue date cloture
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildDateCloture(Date aValue) {
        instance.setDateCloture(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue date creation
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildDateCreation(Date aValue) {
        instance.setDateCreation(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue date enregistrement
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildDateEnregistrement(Date aValue) {
        instance.setDateEnregistrement(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue identifiant intermediaire
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildIdentifiantIntermediaire(String aValue) {
        instance.setIdentifiantIntermediaire(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue nom acteur responsable
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildNomActeurResponsable(String aValue) {
        instance.setNomActeurResponsable(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue nom emetteur
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildNomEmetteur(String aValue) {
        instance.setNomEmetteur(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue nom entite responsable
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildNomEntiteResponsable(String aValue) {
        instance.setNomEntiteResponsable(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue numero reference
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildNumeroReference(String aValue) {
        instance.setNumeroReference(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue periode validite
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildPeriodeValidite(IDateRangeDetailDossier aValue) {
        instance.setPeriodeValidite(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue code origine
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildCodeOrigine(String aValue) {
        instance.setCodeOrigine(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue code priorite
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildCodePriorite(String aValue) {
        instance.setCodePriorite(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue code statut
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildCodeStatut(String aValue) {
        instance.setCodeStatut(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue code type dossier
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildCodeTypeDossier(String aValue) {
        instance.setCodeTypeDossier(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue code issue
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildCodeIssue(String aValue) {
        instance.setCodeIssue(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue identifiant entite responsable
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildIdentifiantEntiteResponsable(String aValue) {
        instance.setIdentifiantEntiteResponsable(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue identifiant responsable
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildIdentifiantResponsable(String aValue) {
        instance.setIdentifiantResponsable(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue code postal
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildCodePostal(String aValue) {
        instance.setCodePostal(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue identifiant
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildIdentifiant(String aValue) {
        instance.setIdentifiant(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue identifiant RCE
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildIdentifiantRCE(String aValue) {
        instance.setIdentifiantRCE(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue libelle civilite
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildLibelleCivilite(String aValue) {
        instance.setLibelleCivilite(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue localite
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildLibelleLocalite(String aValue) {
        instance.setLibelleLocalite(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue libelle type
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildLibelleType(String aValue) {
        instance.setLibelleType(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue nom
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildNom(String aValue) {
        instance.setNom(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue nom rue
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildNomRue(String aValue) {
        instance.setNomRue(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue numero portable
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildNumeroPortable(String aValue) {
        instance.setNumeroPortable(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue numero rue
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildNumeroRue(BigInteger aValue) {
        instance.setNumeroRue(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue numero telephone
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildNumeroTelephone(String aValue) {
        instance.setNumeroTelephone(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue prenom
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildPrenom(String aValue) {
        instance.setPrenom(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue libelle nature
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildLibelleNature(String aValue) {
        instance.setLibelleNature(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue nom campagne
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildNomCampagne(String aValue) {
        instance.setNomCampagne(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue identifiant campagne
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildIdentifiantCampagne(String aValue) {
        instance.setIdentifiantCampagne(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue identifiant contrat
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildIdentifiantContrat(String aValue) {
        instance.setIdentifiantContrat(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue montant annuel HT
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildMontantAnnuelHT(IMonetaryQuantity aValue) {
        instance.setMontantAnnuelHT(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue montant total versement
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildMontantTotalVersement(IMonetaryQuantity aValue) {
        instance.setMontantTotalVersement(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue montant total VP
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildMontantTotalVP(IMonetaryQuantity aValue) {
        instance.setMontantTotalVP(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue sous type
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildSousType(String aValue) {
        instance.setSousType(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue description note
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildDescriptionNote(String aValue) {
        instance.setDescriptionNote(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue motifs
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildMotifs(List<IMotifsDetailDossier> aValue) {
        instance.setMotifs(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue added motif
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildAddedMotif(IMotifsDetailDossier aValue) {
        if (instance.getMotifs() == null) {
            instance.setMotifs(new ArrayList<IMotifsDetailDossier>());
        }

        ((ArrayList<IMotifsDetailDossier> ) instance.getMotifs()).add(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue famille produit
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildFamilleproduit(List<IFamilleProduitDetailDossier> aValue) {
        instance.setFamilleproduit(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue added famille produit element
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildAddedFamilleproduitElement(IFamilleProduitDetailDossier aValue) {
        if (instance.getFamilleproduit() == null) {
            instance.setFamilleproduit(new ArrayList<IFamilleProduitDetailDossier>());
        }

        ((ArrayList<IFamilleProduitDetailDossier> ) instance.getFamilleproduit()).add(aValue);

        return (GeneratorT ) this;
    }
}
